import { LoaderManager } from "../../../../com/gengine/resource/LoaderManager";
import { StaticResUrl } from "../../resource/StaticResUrl";
import { GButton } from "../../../../com/mui/controls/GButton";
import { SWFInfo } from "../../../../com/gengine/resource/info/SWFInfo";
//class VersionChangeTips
    
    export  class VersionChangeTips /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.initUI();
            return;
        }

        protected initUI(): void
        {
            LoaderManager.instance.load(StaticResUrl.LoginNoticeTips, this.onTipsLoadedHandler);
            this._closeBtn = new GButton();
            this._closeBtn.styleName = "CloseButton";
            this._closeBtn.setSize(20, 18);
            this._closeBtn.label = "";
            this._closeBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onCloseBtnClickHandler);
            return;
        }

        /* internal  */onCloseBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this.parent) 
            {
                this.parent.removeChild(this);
            }
            return;
        }

        /* internal  */onTipsLoadedHandler(arg1: SWFInfo): void
        {
            if (arg1 && arg1.clip) 
            {
                this._tipsMc = arg1.clip;
                this._tipsMc.mouseEnabled = false;
                addChildAt(this._tipsMc, 0);
                this._closeBtn.x = this._tipsMc.width - this._closeBtn.width - 4;
                this._closeBtn.y = 50;
                this.addChild(this._closeBtn);
            }
            return;
        }

        protected /* var */_closeBtn: GButton;

        protected /* var */_tipsMc: Object /* flash.display.MovieClip */;
    }
